import request from "@/utils/request";


//创建订单
export let reqSubmitOrder = (hoscode: string, scheduleId: string, patientId: number) => request.post(`/order/orderInfo/auth/submitOrder/${hoscode}/${scheduleId}/${patientId}`)

//根据订单id获取订单数据
export let reqOrderInfo = (id:string) => request.get(`/order/orderInfo/auth/getOrderInfo/${id}`)

// 根据订单id取消预约
export let reqCancelOrder = (orderId:string) => request.get(`/order/orderInfo/auth/cancelOrder/${orderId}`)

//生成微信支付二维码
export let reqQrCode = (orderId:string) => request.get(`/order/weixin/createNative/${orderId}`)

//查询支付状态
export let reqPayStatus = (orderId:string) => request.get(`/order/weixin/queryPayStatus/${orderId}`)

//获取用户信息
export let reqUserInfo = () => request.get(`/user/auth/getUserInfo`)

// 获取证件类型方法
export let reqCertationType= (dictCode:string='CertificatesType') => request.get(`/cmn/dict/findByDictCode/${dictCode}`)

// 用户提交认证
export let reqUserAuah= (data:authParam) => request.post(`/user/auth/userAuah`,data);

// 请求订单全部数据
export const reqUserOrderInfo = (page: number, limit: number, patientId: string, orderStatus: string) => request.get( `/order/orderInfo/auth/${page}/${limit}?patientId=${patientId}&orderStatus=${orderStatus}`)

// 根据订单状态展示订单
export const reqOrderState = () => request.get('/order/orderInfo/auth/getStatusList');

// 全部就诊人展示订单
export const reqAllUser = () => request.get('/user/patient/auth/findAll');

// 获取城市数据
export const reqCity= (parentId:string) => request.get(`/cmn/dict/findByParentId/${parentId}`);

//新增与修改已有的就诊人接口方法
export const reqAddOrUpdateUser = (data) => {
    if (data.id) {
        return request.put('/user/patient/auth/update', data);
    } else {
        return request.post('/user/patient/auth/save', data);
    }
}

// 删除已有就诊人卡片
export const reqDeletePatient = (id:number) => request.delete(`/user/patient/auth/remove/${id}`);



